package com.kuang.lesson06;

import javax.swing.*;
import java.awt.*;
import java.util.Vector;

public class TestComboxDemo02 extends JFrame {
    public TestComboxDemo02() {
        Container container = this.getContentPane();

        //生成列表的内容
        //String[] content = {"1","2","3"};
        Vector content = new Vector();
        //列表中需要放入内容
        JList list = new JList(content);

        content.add("zhangsan");
        content.add("lisi");
        content.add("wangwu");


        container.add(list);

        this.setVisible(true);
        this.setSize(500,350);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        new TestComboxDemo02();
    }
}
